package student.view.MainViewTable;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.util.Vector;

public class MainViewCellRender extends DefaultTableCellRenderer {
    public Component getTableCellRenderComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row , int column){
        if(row%2==0){
            setBackground(Color.LIGHT_GRAY);
        }else {
            setBackground((Color.WHITE));
        }
        setHorizontalAlignment(DefaultTableCellRenderer.CENTER);
        return super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
    }
}
